#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>

int main()
{
  printf("hello bit\n");
  pid_t ret=fork();  //fork()创建子进程
  if(ret<0)
  {
    printf("fork error\n");
  }
  else if(ret==0)//子进程ret返回0
  {
    printf("I am child\n");
  }
  else  //父进程返回值大于0
  {
    sleep(5);
    exit(0);
    //printf("I am parent\n");
  }
  while(1)
  {
    printf("--------\n");
    sleep(1);
  }

  return 0;
}
